package main

import "fmt"

func bubbleSort(a [5]int) [5]int {
	for i := 0; i < len(a); i++ {
		for j := 0; j < i; j++ {
			if a[j] > a[j+1] {
				a[j], a[j+1] = a[j+1], a[j]
			}
		}
	}
	return a
}
func printResult(a [5]int) {
	for i := 0; i < 5; i++ {
		fmt.Printf("a[%d]=%d\n", i, a[i])
	}
}
func main() {
	//传值
	var arr = [5]int{2, 49, 89, 20, 90}
	printResult(arr)
	bubbleSort(arr)
	printResult(arr)
}
